home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer 2.0 / Internet Surfer 2.0 (Wayzata Technology) (1996).iso / pc / text / mac / faqs.124 < prev    next >
Text File  |  1996-02-12  |  29KB  |  616 lines

  1. Frequently Asked Questions (FAQS);faqs.124
  2.  
  3.  
  4.  
  5. Q.  WHAT ABOUT COPYRIGHT ISSUES?
  6. A.  Currently, wireless cable systems have assumed that they may use a
  7.     compulsory license to pay for copyright issues (similar to what cable
  8.     companies do today).  A compulsory license enables systems to
  9.     re-transmit broadcast signals for a pre-established fee to compensate
  10.     producers of TV programs.  The copyright office recently announced that
  11.     wireless cable is NOT a cable system,  therefore, these systems may not
  12.     use compulsory licenses.  They have decided, though, that wireless cable
  13.     systems may continue to use the compulsory license for two years (I will
  14.     try to get an exact date).  I have heard of some legislation that may
  15.     allow small cable companies and wireless cable companies to use a
  16.     compulsory license for up to 11 years.  I don't think that anything has
  17.     happened with this bill yet, though.  Hopefully, there will be more
  18.     legislation on this point.
  19.  
  20. Q.  WHAT IS THE HISTORY OF MMDS?
  21. A.  It is a fairly new service that developed from MDS (multi-point
  22.     distribution service) which could only send one or two channels.
  23.     Originally, the FCC thought MDS would be used primarily to send business
  24.     data.  However, since MDS's creation in the early 70's, the service has
  25.     become increasingly popular in sending entertainment programming.
  26.     Because the FCC does not regulate the content of the transmission,
  27.     alternative uses would not be prohibited.
  28.  
  29. Q.  HOW DOES MMDS WORK COMMERCIALLY?
  30. A.  A MMDS licensee, which is similar to a broadcast station owner, leases
  31.     transmission time to programmers on a first-come, first-served basis.
  32.     The programmers, in turn, are responsible for designing and selling
  33.     their programs to the subscriber.
  34.     A MMDS applicant can choose to operate as a common carrier.  In the
  35.     telecommunications industry, a common carrier also may provide services
  36.     such as audio only transmissions, telephone, or data.
  37.     If a MMDS licensee is currently operating as a common carrier, the FCC
  38.     requires that the licensee and the programmer not be related or
  39.     affiliated.  A common carrier offers transmission service for hire and
  40.     cannot control program material or serve primarily its other business
  41.     interests.
  42.     A MMDS applicant can alternatively choose to operate as a non-common
  43.     carrier.  This scenario in effect would constitute a non-common carrier
  44.     wireless cable system.
  45.  
  46. Q.  HOW DO I APPLY FOR THE FREQUENCIES?
  47. A.  First, you should contact the FCC and get the proper applications.  This
  48.     includes the following forms:
  49.     FCC form 430  -  Licensee qualification report
  50.     FCC form 494  -  Application for a new or modified microwave radio
  51.                      station license under Part 21
  52.     FCC form 701  -  Application for additional time to construct a radio
  53.                      station (Just in case something happens!)
  54.     FCC form 494A -  Certification of completion of construction
  55.     THE FCC HAS CURRENTLY PLACED A FREEZE ON ALL NEW APPLICATIONS UNTIL THEY
  56.     CAN PROCESS THE BACKLOG AND SETUP NEW PROCEDURES TO DEAL WITH ALL OF THE
  57.     NEW APPLICATIONS.  They say they were getting about 1,000 applications a
  58.     month!
  59.  
  60. Q.  HOW ARE LICENSEES SELECTED?
  61. A.  When more than one application using the same E or F group of
  62.     frequencies is accepted for filing proposing a multichannel MDS station
  63.     in the same service area, the Commission will use a lottery (random
  64.     selection) to award a conditional license.  Minority preference and/or
  65.     diversity preference may be claimed by the applicant.  The factors used
  66.     to determine if an applicant qualifies for either type of preference are
  67.     explained in Section V of FCC Form 346.  When more than one application
  68.     using channel 1, 2 or 2A in the same service area is filed, the
  69.     Commission will use a comparative hearing to award a conditional license
  70.     (construction authorization).
  71.     Charles Gratch, who heads applications processing in FCC's Domestic
  72.     Facilities Div., said he often tells callers that they don't need a
  73.     license to enter the wireless cable field; he advises them to find
  74.     licensees who can't put together a system and try to collect enough
  75.     channels to start a business, eliminating long and speculative lottery
  76.     processes.  Even with new rules approved by the FCC (TVD Oct 15 p5),
  77.     challenges to develop wireless cable, particularly if there's an
  78.     existing cable system, will be formidable, Schmidt said. Wireless cable
  79.     services also could face increasing competition from satellites, he
  80.     said.
  81.  
  82. Q.  WHAT IS THE RANGE OF WIRELESS CABLE?
  83. A.  Wireless cable systems usually get a range of 25-30 miles (this depends
  84.     on the terrain, as the transmitting and receiving antennas must be line-
  85.     of-site).  This may make it feasible in rural areas.
  86.  
  87. Q.  WHAT ARE THE COSTS OF A NEW STATION?
  88. A.  According to a couple of books and magazine articles that I have read,
  89.     the cost to build a wireless cable station is much less than that of a
  90.     regular cable system.  This is because cables don't have to be strung
  91.     all over town.  In comparison to the cost of cable, a 10-watt
  92.     transmitter only costs about $17,000.  When combined with the antenna
  93.     structure and monitoring, switching, and originating equipment, it costs
  94.     about $150,000.  (These are 1988 figures and they do not consider the
  95.     costs for antennas and downconverters).  Because of the low initial
  96.     investment costs, it is possible for wireless cable systems to charge
  97.     less than their regular cable counter-parts.
  98.     According to one article in Forbes Magazine, "Since March of last year,
  99.     Charles Mauszycki's tiny Family Entertainment Network (1989 revenues,
  100.     $564,000) has signed up 1,200 of Sioux Falls' 8,000 outlying homes for
  101.     its wireless cable system.  Cost:$17.95 a month for basic cable, plus
  102.     $9.95 a month for Showtime.  Mauszycki says that the system, less than
  103.     one year old, already has positive cash flow."  This particular system
  104.     was set up in a rural farming community that did not already have cable
  105.     service.  Mr. Mauszycki spent about $800,000 to build his system.  This
  106.     is less than $700 per subscriber.  The article also mentions that if
  107.     penetration reached 40%, then the incremental cost of adding the
  108.     subscribers would bring the cost of the system down to just under $500
  109.     per subscriber.  To put these figures in perspective, it costs regular
  110.     cable systems an average of $2,300 per subscriber.  (Forbes Magazine,
  111.     February 19, 1990.  "The wireless wonder" by Fleming Meeks)
  112.     According to the Wireless Cable Association, a complete headend should
  113.     cost no more than $1.7 million.  Usually, you can lower this cost
  114.     considerably.
  115.  
  116. Q.  IS WIRELESS CABLE EQUIPMENT RELIABLE?
  117. A.  Several excellent manufacturers produce antennas and downconverters for
  118.     signal reception and decoder boxes that sit on the customer's television
  119.     which are connected by coaxial cable to the roof antenna.
  120.     Because the signal is broadcast over the air, it is more reliable than
  121.     conventional cable and the quality is better than or equal to ordinary
  122.     cable.  Extreme weather conditions do not affect wireless cable's
  123.     transmitters, so their customers will never experience the outages that
  124.     are so common in conventional cable.
  125.  
  126. Q.  WHAT ABOUT SECURITY?
  127. A.  Absolute signal security is provided by encoding each wireless cable
  128.     channel and equipping the converter with a decoding device that responds
  129.     to a pilot signal carrying a data stream with authorization
  130.     instructions.  Thus, the system is totally addressable.  No converter
  131.     box will have any utility unless it is authorized for service by the
  132.     central computer.  All channels, both Basic and Premium, are hard
  133.     scrambled.  Because the wireless cable system is addressable, it also
  134.     can accommodate pay-per-view service.
  135.  
  136. Q.  HOW ARE WIRELESS CABLE SYSTEMS REGULATED?
  137. A.  The FCC has specifically preempted local regulation of wireless cable
  138.     frequencies, asserting that it is interstate commerce.  There is no
  139.     basis for local regulation of the wireless signal.  Unlike cable, no
  140.     public rights of way are used, and all transmission and reception
  141.     equipment is on private property.  Furthermore, the antennas are so
  142.     similar to regular television antennas that there can be no basis for
  143.     zoning restriction.
  144.  
  145. Q.  WHAT ARE THE BENEFITS OF WIRELESS CABLE TO THE CUSTOMER?
  146. A.  Availability:  Wireless Cable is available to subscribers NOW, whereas
  147.     traditional cable can't or won't be for years to come.
  148.     Reliability & Quality:  Wireless Cable is not subject to traditional
  149.     cable's outages or signal degradation.  Picture quality is as good or
  150.     better than coaxial cable.
  151.     Affordability:  Wireless Cable offers affordable programming packages
  152.     and is priced below or competitively with traditional cable.
  153.     IN SHORT, WIRELESS CABLE IS THE NEXT GENERATION OF CABLE TELEVISION
  154.     PROVIDING THE BEST IN SATELLITE CABLE PROGRAMMING, AVAILABLE NOW, AND AT
  155.     LOWER COST.
  156.  
  157. Q.  IS THERE AN INDUSTRY ASSOCIATION?
  158. A.  Wireless cable operators, license holders, and equipment/service
  159.     suppliers have formed the Wireless Cable Association.  Among its
  160.     activities the WCA has established a set of industry standards, both
  161.     business and technical.  The WCA has also made the industry's concerns
  162.     known on Capitol Hill and at Federal agencies such as the FCC, NTIA,
  163.     OTA and DOJ.  Current legislative efforts are focused on securing right
  164.     of access to programming services.  The WCA has also opened channels of
  165.     communication with organizations such as the National League of Cities,
  166.     NATOA, MPAA and the Association of State Attorneys General.
  167.  
  168. Q.  I SAW ONE OF THOSE 'INFOMERCIALS' ABOUT WIRELESS CABLE.  ARE THESE
  169.     COMPANIES LEGIT?
  170. A.  While some of these companies may be legit, there are some things that
  171.     they don't disclose.  Because of this, two companies have had temporary
  172.     restraining orders placed against them.  A judge has placed some of the
  173.     following restrictions on them.
  174.     1.  They may no longer state that applicants are "virtually guaranteed"
  175.         of winning a license in the FCC lottery or that most wireless cable
  176.         licenses are "highly valuable."
  177.     2.  "There may be substantial delays in the awarding of any MMDS
  178.         [Multichannel Multipoint Distribution System] license due to the
  179.         length of time the FCC takes to process MMDS applications and award
  180.         MMDS licenses."
  181.     3.  That financing for wireless cable systems is hard to get, "given the
  182.         relatively new nature of this field of technology and that such
  183.         financing may require additional funds of the customer's own money
  184.         as a condition" to obtaining system.
  185.     4.  Provide a new "Risk Disclosure" statement that applicants must sign
  186.         before sale is completed. This statement informs applicants, among
  187.         other items, that any representations of value of systems are
  188.         opinions and not actual values, that the winner of a MMDS lottery
  189.         wins only 4 channels and that there may be competition with
  190.         satellite, VCR, and other media.
  191.     Temporary Restraining Orders have been placed on, or have been filed
  192.     against: 1) Applied Telemedia Engineering and Management (A-TEAM) and
  193.     2) Applied Cable Technologies (ACT).  If you deal with any type of
  194.     application preparation firm, be very careful and read EVERYTHING.
  195.     Other companies that MAY be questionable include Communications
  196.     Engineering Management Services (CEMS), Decaxo Capital, Techno Source,
  197.     and Western Wireless.  These companies have management that were
  198.     involved in a company selling cellular licenses.  This company was
  199.     forced out of business by the FCC for misleading customers.  Other
  200.     questionable companies include MMDS Technologies, Metro Communications
  201.     Group, and Tele-Wave Technology.  I have not heard anything about any
  202.     other application preparation firm.
  203.     Also, take note that there is a freeze on all applications at this time
  204.     and the FCC is currently changing what type of data will be needed for
  205.     the application.
  206.     Also, please note the following public notice issued by the FCC:
  207.  
  208. ****************************************************************************
  209.                  Public Notice  -  13244  -  May 24, 1991
  210.  
  211.       DOMESTIC FACILITIES DIVISION ADVISORY FOR MULTICHANNEL MULTIPOINT
  212.                        DISTRIBUTION SERVICE APPLICANTS
  213.  
  214.   It has come to our attention that application preparation firms are
  215. offering settlement opportunities to Multichannel Multipoint Distribution
  216. Service (MMDS) applicants as part of their application preparation services.
  217.  
  218.   Applicants may not enter into a settlement agreement prior to having their
  219. application placed on public notice as accepted for filing.  Until an
  220. application has been accepted for filing, it may be returned as unacceptable
  221. and thus would not be eligible to be included in the lottery for a
  222. particular market.  An application which is ineligible to be included in a
  223. lottery is not eligible to be included in a settlement group and could not
  224. be counted towards the cumulative chances awarded to a settlement group.  47
  225. U.S.C. S309(i), 47 C.F.R. S21.33(b).
  226.  
  227.   Moreover, each person entering into a settlement group must demonstrate
  228. that the MMDS application was filed without the intention of entering into a
  229. settlement group.  Each individual applicant for MMDS must be the real party
  230. in interest of its application.  47 C.F.R.  SS21.13(a)(1), 21.33.
  231.  
  232.   Any questions may be addressed to Susan Magnotti, Domestic Radio Branch,
  233. (202)-634-1773.
  234.  
  235. -FCC-
  236. ****************************************************************************
  237.  
  238. Q.  WHO DO I CONTACT FOR MORE INFORMATION?
  239. A.  FCC
  240.     Common Carrier Bureau
  241.     Washington, DC  20554
  242.     (202) 634-1706
  243.  
  244.     Wireless Cable Association International, Inc.
  245.     2000 L Street, NW Suite 702
  246.     Washington, DC  20036
  247.     (202) 452-7823
  248.  
  249. ---------------
  250.  
  251. EQUIPMENT:
  252. There are several companies that provide equipment and consulting services.
  253. If you are interested in this, you may want to pick up the latest copy of
  254. The Broadcasting Yearbook or Multichannel News.  These can be found at most
  255. large libraries.
  256.  
  257. Also, I would strongly suggest calling the FCC and the WCA and ask for more
  258. information.
  259.  
  260. ---------------
  261.  
  262. For additions, clarifications, corrections, or if you just have a few
  263. questions, please feel free to e-mail me.
  264.  
  265. DISCLAIMER:  I have no affiliation with any MMDS, MDS, DBS, ITFS, OFS,
  266. Radio, Television, broadcast station, or regular cable system.  I am
  267. definitely not an expert in any of these areas.  I have tried, to the best
  268. of my ability, to interpret and relay the most accurate and up to date
  269. information.  However, I do not guarantee the accuracy of this information
  270. as some of my sources may be biased or incorrect.
  271.  
  272. B. J. Catlin
  273. .          
  274. Newsgroups: comp.windows.x.intrinsics,comp.windows.x,news.answers
  275. Path: bloom-picayune.mit.edu!enterpoop.mit.edu!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!oboe.cis.ohio-state.edu!ware
  276. From: ware@oboe.cis.ohio-state.edu (Peter Ware)
  277. Subject: comp.windows.x.intrinsics Frequently Asked Questions (FAQ)
  278. Message-ID: <FAQ-Xt_723479548@oboe.cis.ohio-state.edu>
  279. Followup-To: comp.windows.x.intrinsics
  280. Summary: Answers about the X11 Window System widgets and Xt Intrinsics library
  281. Sender: news@cis.ohio-state.edu (NETnews        )
  282. Supersedes: <FAQ-Xt_718402537@oboe.cis.ohio-state.edu>
  283. Reply-To: ware@cis.ohio-state.edu
  284. Organization: The Ohio State University Dept. of Computer and Info. Science
  285. Date: Fri, 4 Dec 1992 14:32:40 GMT
  286. Approved: news-answers-request@MIT.Edu
  287. Expires: Fri, 15 Jan 1993 14:32:28 GMT
  288. Lines: 1347
  289.  
  290. Archive-name: Xt-FAQ
  291. Version: $Id: FAQ-Xt,v 1.18 92/12/04 09:29:38 ware Exp $
  292.  
  293.             The X Toolkit Intrinsics F.A.Q
  294.               A monthly posting
  295.  
  296.  
  297. This article contains the answers to some Frequently Asked Questions
  298. (FAQ) from comp.windows.x about the X Toolkit Intrinsics.  To submit
  299. questions (preferably with an answer) send email to: ware@cis.ohio-state.edu
  300.  
  301. All code fragments are public domain.
  302.  
  303.                    Contents
  304. 0.  Xt Glossary
  305. 1.  Software Versions
  306. 2.  Related FAQ's
  307. 3.  Why does my application core dump when I use signals/alarms/cthreads?
  308. 4.  How do I use a different visual than the default?
  309. 5.  Which visual should an application use?
  310. 6.  Why do only Shell widgets have a Visual?
  311. 7.  Which visual, depth and colormap do Shells inherit?
  312. 8.  I've done all the above and I still get a BadMatch error.  Why?
  313. 9.  Why doesn't my widget get destroyed when I call XtDestroyWidget()?
  314. 10. How do I exit but still execute the DestroyCallbacks?
  315. 11. How do I resize a Shell widget?
  316. 12. Why can't XtAppAddInput() handle files?
  317. 13. What good books and magazines are there on Xt?
  318. 14. What Widgets are available?
  319. 15. What alternatives to the Intrinsics are there?
  320. 16. How do I pass a float value to XtSetValues?
  321. 17. +++How do I write a resource converter?
  322. 18. How do I open multiple displays?
  323. 19. What changed from R3 to R4 to R5?
  324. 20. Where are the resources loaded from?
  325. 21. What order are callbacks executed in?
  326. 22. How do I know if a widget is visible?
  327. 23. How do I reparent a widget in Xt, i.e. XtReparentWidget()?
  328. 24. Why use XtMalloc, XtFree, etc?
  329. 25. How to debug an Xt application?
  330.  
  331. The "+++" indicates the question needs more of an answer.
  332.  
  333. ----------------------------------------------------------------------
  334. 0.  Xt Glossary
  335. ----------------------------------------------------------------------
  336.  
  337. o The Xt Intrinsics implement an object oriented interface to C code
  338.   to allow useful graphical components to be created.  Included with
  339.   this are classes that provide the base functionality: Object,
  340.   RectObj, Core, Composite, Constraint, Shell, OverrideShell, WMShell,
  341.   etc.  The terms "Xt" and "Intrinsics" are used interchangeably,
  342.   however, they are used very precisely to mean a specific library of the X
  343.   window system.  In particular, it does not include the Athena,
  344.   Motif, OLIT or any other widget set.  Without further widgets the
  345.   Intrinsics are not especially useful.
  346.  
  347. o A widget refers to a user interface abstraction created via Xt.  The
  348.   precise use, is any object that is a subclass of the Core class.  It
  349.   is used loosely to refer to anything that is a subclass of the
  350.   Object class although these are more accurately called windowless
  351.   widgets or gadgets.
  352.  
  353. o Xlib is the C interface to the X11 protocol.  It is one layer below
  354.   the Xt Intrinsics.  Typically a widget uses relatively few Xlib
  355.   functions because Xt provides most such services although an
  356.   understanding of Xlib helps with problems.
  357.  
  358. ----------------------------------------------------------------------
  359. 1.  Software Versions
  360. ----------------------------------------------------------------------
  361.  
  362. The following are the latest versions of Xt based software:
  363.         _____________________________________________________________
  364.     Software    Version        Released    Next Expected
  365.         _____________________________________________________________
  366.     X11R4        patch 18            (none)
  367.     X11R5        patch 17    8/27/92        ??
  368.     Athena Widgets    (see X11R5)
  369.     Motif        1.2.1        9/92        ??
  370.     OLIT        ??        ??        ??
  371.     Xtra        2.5        6/15/92        ??
  372.     Xw        X11R4                (none)
  373.     Xcu        X11R5                (none)
  374.     fwf        3.2        6/08/92        ??
  375.         _____________________________________________________________
  376.  
  377. ----------------------------------------------------------------------
  378. 2.  Related FAQ's
  379. ----------------------------------------------------------------------
  380. David B. Lewis (uunet!craft!faq) maintains the FAQ on X.  It
  381. is posted monthly on comp.windows.x and located on export in contrib/FAQ.
  382.  
  383. Liam R. E. Quin (lee@sq.sq.com) posts an FAQ list on Open Look to
  384. comp.windows.x.
  385.  
  386. Jan Newmarch (jan@pandonia.canberra.edu.au) posts an FAQ list on Motif
  387. to comp.windows.x.motif.
  388.  
  389. Peter Ware (ware@cis.ohio-state.edu) posts an FAQ list for
  390. comp.windows.x.intrinsics; it is on export in contrib/FAQ-Xt.
  391.  
  392. ----------------------------------------------------------------------
  393. 3.  Why does my application core dump when I use signals/alarms/cthreads?
  394. ----------------------------------------------------------------------
  395.  
  396. In brief, Xlib, Xt and most widget sets have no mutual exclusion for
  397. critical sections.  Any interrupt handler is likely to leave one of
  398. the above libraries in an inconsistent state -- such as all the
  399. appropriate flags not yet set, dangling pointers, in the middle of a
  400. list traversal, etc.  Note that the ANSI C standard points out that
  401. behavior of a signal handler is undefined if the signal handler calls
  402. any function other than signal() itself, so this is not a problem
  403. specific to Xlib and Xt; the POSIX specification mentions other
  404. functions which may be called safely but it may not be assumed that
  405. these functions are called by Xlib or Xt functions.
  406.  
  407. The only safe way to deal with signals is to set a flag in the
  408. interrupt handler.  This flag later needs to be checked either by a
  409. work procedure or a timeout callback.  It is incorrect to add either
  410. of these in the interrupt handler.  As another note, it is dangerous
  411. to add a work procedure that never finishes.  This effectively
  412. preempts any work procedures previously added and so they will never
  413. be called.  Another option is to open a pipe, tell the event loop
  414. about the read end using XtAppAddInput() and then the signal handler
  415. can write a byte to the write end of the pipe for each signal.
  416. However, this could deadlock your process if the pipe fills up.
  417.  
  418. Why don't the Intrinsics deal with this problem?  Primarily because it
  419. is supposed to be a portable layer to any hardware and operating
  420. system.   Is that a good enough reason -- I don't think so.
  421.  
  422.         Note: the article in The X Journal 1:4 and the example in O'Reilly
  423. Volume 6 are in error.
  424.  
  425. ----------------------------------------------------------------------
  426. 4.  How do I use a different visual than the default?
  427. ----------------------------------------------------------------------
  428.  
  429. This requires a more complicated answer than it should.  A window has
  430. three things that are visual specific -- the visual, colormap and
  431. border pixmap.  All widgets have their own Colormap and BorderPixmap
  432. resource; only shell widgets have Visual resources (another questions
  433. deals with why shells have a Visual).  The default value of these
  434. resources is CopyFromParent which does exactly what it says.  In the
  435. shell widget CopyFromParent gets evalulated as DefaultVisualOfScreen
  436. and DefaultColormapOfScreen.  When any one of the three resources is
  437. not properly set, a BadMatch error occurs when the window is
  438. created.  They are not properly set because each of the values depends
  439. on the visual being used.
  440.  
  441. How to get this to work?  There are two parts to the answer.  The
  442. first is if you want an application to start with a particular visual
  443. and the second is if you want a particular shell within an application
  444. to start with a different visual.  The second is actually easier
  445. because the basic information you need is available.  The first is a
  446. little harder because you'll need to initialize much of the toolkit
  447. yourself in order to determine the needed information.
  448.  
  449. /*
  450.  * Some sample code to start up an application using something other
  451.  * than the default visual.
  452.  *
  453.  * To compile:
  454.  *    cc -g visual.c -o visual -lXaw -lXmu -lXt -lXext -lX11 -lm
  455.  *
  456.  * To run:
  457.  *    ./visual -geometry 300x300 -visual StaticColor -fg blue -bg yellow
  458.  *
  459.  * you need to move the mouse to get the particular visuals colormap
  460.  * to install.
  461.  */
  462.  
  463. #include <X11/Intrinsic.h>
  464. #include <X11/StringDefs.h>
  465. #include <X11/Shell.h>
  466.  
  467. typedef struct
  468. {
  469.     Visual    *visual;
  470. } OptionsRec;
  471.  
  472. OptionsRec    Options;
  473.  
  474. XtResource resources[] =
  475. {
  476.     {"visual", "Visual", XtRVisual, sizeof (Visual *),
  477.     XtOffsetOf (OptionsRec, visual), XtRImmediate, NULL},
  478. };
  479.  
  480. XrmOptionDescRec Desc[] =
  481. {
  482.     {"-visual", "*visual", XrmoptionSepArg, NULL}
  483. };
  484.  
  485.  
  486.  
  487. int
  488. main (argc, argv)
  489.     int        argc;
  490.     char        **argv;
  491. {
  492.     XtAppContext    app;        /* the application context */
  493.     Widget        top;        /* toplevel widget */
  494.     Display        *dpy;        /* display */
  495.     char        **xargv;    /* saved argument vector */
  496.     int        xargc;        /* saved argument count */
  497.     Colormap    colormap;    /* created colormap */
  498.     XVisualInfo    vinfo;        /* template for find visual */
  499.     XVisualInfo    *vinfo_list;    /* returned list of visuals */
  500.     int        count;        /* number of matchs (only 1?) */
  501.     Arg        args[10];
  502.     Cardinal    cnt;
  503.     char        *name = "test";
  504.     char        *class = "Test";
  505.  
  506.     /*
  507.      * save the command line arguments
  508.      */
  509.  
  510.     xargc = argc;
  511.     xargv = (char **) XtMalloc (argc * sizeof (char *));
  512.     bcopy ((char *) argv, (char *) xargv, argc * sizeof (char *));
  513.  
  514.     /*
  515.      * The following creates a _dummy_ toplevel widget so we can
  516.      * retrieve the appropriate visual resource.
  517.      */
  518.     cnt = 0;
  519.     top = XtAppInitialize (&app, class, Desc, XtNumber (Desc), &argc, argv,
  520.                    (String *) NULL, args, cnt);
  521.     dpy = XtDisplay (top);
  522.     cnt = 0;
  523.     XtGetApplicationResources (top, &Options, resources,
  524.                    XtNumber (resources),
  525.                    args, cnt);
  526.     cnt = 0;
  527.     if (Options.visual && Options.visual != DefaultVisualOfScreen (XtScreen (top)))
  528.     {
  529.         XtSetArg (args[cnt], XtNvisual, Options.visual); ++cnt;
  530.         /*
  531.          * Now we create an appropriate colormap.  We could
  532.          * use a default colormap based on the class of the
  533.          * visual; we could examine some property on the
  534.          * rootwindow to find the right colormap; we could
  535.          * do all sorts of things...
  536.          */
  537.         colormap = XCreateColormap (dpy,
  538.                         RootWindowOfScreen (XtScreen (top)),
  539.                         Options.visual,
  540.                         AllocNone);
  541.         XtSetArg (args[cnt], XtNcolormap, colormap); ++cnt;
  542.  
  543.         /*
  544.          * Now find some information about the visual.
  545.          */
  546.         vinfo.visualid = XVisualIDFromVisual (Options.visual);
  547.         vinfo_list = XGetVisualInfo (dpy, VisualIDMask, &vinfo, &count);
  548.         if (vinfo_list && count > 0)
  549.         {
  550.             XtSetArg (args[cnt], XtNdepth, vinfo_list[0].depth);
  551.             ++cnt;
  552.             XFree ((XPointer) vinfo_list);
  553.         }
  554.     }
  555.     XtDestroyWidget (top);
  556.  
  557.  
  558.     /*
  559.      * Now create the real toplevel widget.
  560.      */
  561.     XtSetArg (args[cnt], XtNargv, xargv); ++cnt;
  562.     XtSetArg (args[cnt], XtNargc, xargc); ++cnt;
  563.     top = XtAppCreateShell ((char *) NULL, class,
  564.                 applicationShellWidgetClass,
  565.                 dpy, args, cnt);
  566.  
  567.     /*
  568.      * Display the application and loop handling all events.
  569.      */
  570.     XtRealizeWidget (top);
  571.     XtAppMainLoop (app);
  572.     return (0);
  573. }
  574.  
  575. ----------------------------------------------------------------------
  576. 5.  Which visual should an application use?
  577. ----------------------------------------------------------------------
  578.  
  579. This is a point that can be argued about but one opinion is there is
  580. no way for an application to know the appropriate visual -- it has to
  581. be specified by the user.  If you disagree with this then your
  582. application probably falls into the category of always using the
  583. default visual or it is hardware specific and expects some particular
  584. visual such as 24bit TrueColor with an OverlayPlane extension (or some
  585. such).
  586.  
  587. Why?  No application runs in isolation.  Depending on the way a server
  588. allocates resources I may not always want your application to run in
  589. TrueColor mode if it is going to mess up my other applications.  I may
  590. be very upset if it chooses to run in GreyScale instead of PsuedoColor
  591. or just monochrome.
  592.  
  593. As an example, on a low end color Sun server there are many different
  594. possible visuals: monochrome, 256 entry colormap, static gray, static
  595. color, and a 3/3/2 TrueColor.  The SGI Iris's offer all the above
  596. plus 12 bit TrueColor, 24 bit TrueColor, an Overlay Plane.
  597.  
  598. ----------------------------------------------------------------------
  599. 6.  Why do only Shell widgets have a Visual?
  600. ----------------------------------------------------------------------
  601.  
  602. This is strictly by convention.  It makes it possible for an arbitrary
  603. widget to know that the visual it uses can be found by looking for the
  604. shell widget that is its ancestor and obtaining the visual of that
  605. shell.
  606.  
  607. A widget can have its own visual resource.  If it does, it must have
  608. its own realize method to use the visual when it calls
  609. XCreateWindow().  You should also make this a resource that can be
  610. obtained with XtGetValues() so other widgets can find it.  A
  611. reasonable value is probably XtNvisual.
  612.  
  613. ----------------------------------------------------------------------
  614. 7.  Which visual, depth and colormap do Shells inherit?
  615. ----------------------------------------------------------------------
  616.